package com.service.kaptcha.service.impl;

import com.service.kaptcha.mapper.SysPicCodeMapper;
import com.service.kaptcha.model.SysPicCode;
import com.service.kaptcha.service.ValidateCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ValidateCodeServiceImpl implements ValidateCodeService {

    @Autowired
    private SysPicCodeMapper sysPicCodeMapper;

    @Override
    public void save(SysPicCode validateCode) {
        sysPicCodeMapper.insert(validateCode);
    }

    @Override
    public List<SysPicCode> getByAddressIp(String addressIp) {
        return sysPicCodeMapper.findByAddressIp(addressIp);
    }

    @Override
    public SysPicCode getByUUID(String uuid) {
        return sysPicCodeMapper.findByUuid(uuid);
    }
}
